package mysql;

import java.io.InputStream;
import java.util.Properties;

public class res {
    public static void main(String[] args) throws Exception{
        //用来操作配置文件当中的信息
        Properties properties = new Properties();
        //反射去加载配置文件
        InputStream is = res.class.getClassLoader().getResourceAsStream("mysql.properties");
        //使用properties对象加载输入流
        properties.load(is);
        String driver = properties.getProperty("driver");
        String url = properties.getProperty("url");
        String username = properties.getProperty("username");
        String password = properties.getProperty("password");
    }
}
